package com.zenob.secalendar.pim;

import java.util.Enumeration;
import java.util.Vector;

import javax.microedition.pim.EventList;
import javax.microedition.pim.PIM;
import javax.microedition.pim.PIMException;

import org.eclipse.swt.widgets.Event;

import com.zenob.common.log.Log;

public class PimCalendarManager {

	private final static String TAG = "PimCalendarManager";
	
	private PIM mPim;
	
	public PimCalendarManager() {
		mPim = PIM.getInstance();
	}
	
	public Vector getAllEvents() {
		
		Vector events = new Vector();
		
		
		try {
			EventList eventList = (EventList) mPim.openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
			
			Enumeration pimEvents = eventList.items();
		
			while(pimEvents.hasMoreElements()) {
				
				Event event =(Event)pimEvents.nextElement();
			}
		} 
		catch (PIMException e) {
			Log.e(TAG, e.toString());
		}
		
		
		
		return events;
	}
	
	
	
	public void logEvent(Event event) {
		
		Log.d(TAG, "logEvent");
		
		if(event==null) { 
			Log.e(TAG, "event cannot be null");
			return;
		}
		

		

		
		
	}
}
